------------------------------------------------------------------------------------------------------------------
      name:  <unnamed>
       log:  C:\Users\sgolder\Dropbox\Portfolio Allocation\replication\figure1.log
  log type:  text
 opened on:  30 Mar 2017, 13:55:31

. 
. set more off

. #delimit ;
delimiter now ;
. *     ***************************************************************** *;
. *     ***************************************************************** *;
. *       File-Name:      africancabinets_figure1.do                      *;
. *       Date:           September 28, 2016                              *;
. *       Author:         Molly Ariotti and Sona Golder                   *;
. *       Purpose:        Produce Figure 1 for CPS African portfolio      *;
. *                       allocation paper.                               *;
. *           Input File:     Europe.dta                                      *;
. *       Output File:    figure1.log, europe.eps                         *;
. *       Data Output:    none                                            *;
.              *       Previous file:  none                                            *;
. *       Machine:        laptop                                                          *;
. *     ****************************************************************  *;
. *     ****************************************************************  *;
. use "C:\Users\sgolder\Dropbox\Portfolio Allocation\replication\Europe.dta";

. sum;

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
        year |        807     1837.03    490.8286         59       1999
       party |        807     8.30855    3.828548          1         24
 party_seats |        807    57.07311    70.83576          2        319
   formateur |        807    .3209418     .467128          0          1
   seatshare |        807    .3320942    .2454312   .0111732    .971519
-------------+---------------------------------------------------------
portfolios~e |        807    .3320942    .2065127     .03125   .9230769
governmen~os |        807    19.48203    6.107544          8         37
 countryname |          0
 countrycode |        807    6.493185    3.483337          1         14
  portfolios |        807    6.263941    4.305744          1         25
-------------+---------------------------------------------------------
 cabinetcode |        807     132.109    74.45216          1        268
      region |        807           2           0          2          2
     cowcode |        807    296.6679    73.12704        205        395
governmen~ts |        807    179.5217    120.7925         31        473
        code |        807    206625.3     3548.26     201001     214245
-------------+---------------------------------------------------------
presidential |        807           0           0          0          0

. *     ****************************************************************  *;
. *       Drop European cabinets where there is no formateur coded.       *;
. *      (These are caseno 531, 532, 533, 534, 542,543, 617, 858, 859)    *;
. *     ****************************************************************  *;
. drop if code == 205097;
(3 observations deleted)

. drop if code == 205098;
(2 observations deleted)

. drop if code == 205099;
(2 observations deleted)

. drop if code == 205100;
(2 observations deleted)

. drop if code == 205108;
(4 observations deleted)

. drop if code == 205109;
(4 observations deleted)

. drop if code == 207130;
(3 observations deleted)

. drop if code == 209184;
(6 observations deleted)

. drop if code == 209185;
(4 observations deleted)

. *     ****************************************************************  *;
. *       Number of cabinet parties and coalition governments.            *;
. *     ****************************************************************  *;
. sum;

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
        year |        777    1873.147    424.3455         59       1999
       party |        777    8.177606    3.757036          1         24
 party_seats |        777    55.82754    70.19651          2        319
   formateur |        777    .3333333    .4717082          0          1
   seatshare |        777    .3333333    .2451934   .0111732    .971519
-------------+---------------------------------------------------------
portfolios~e |        777    .3333333    .2051144     .03125   .8947368
governmen~os |        777    19.66924    6.124566          8         37
 countryname |          0
 countrycode |        777    6.491634    3.531558          1         14
  portfolios |        777    6.342342    4.320136          1         25
-------------+---------------------------------------------------------
 cabinetcode |        777    132.0785    75.51932          1        268
      region |        777           2           0          2          2
     cowcode |        777     297.601    73.32758        205        395
governmen~ts |        777     174.269    117.9553         31        473
        code |        777    206623.7    3597.324     201001     214245
-------------+---------------------------------------------------------
presidential |        777           0           0          0          0

. sum year if formateur==1;

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
        year |        259    1855.378    456.9596         59       1999

. *     ****************************************************************  *;
. *       Create perfect proportionality data                             *;
. *     ****************************************************************  *;
. gen seats=.;
(777 missing values generated)

. replace seats=_n/100 if _n<101;
(100 real changes made)

. gen ports=.;
(777 missing values generated)

. replace ports=_n/100 if _n<101;
(100 real changes made)

. *     ****************************************************************  *;
. *       Produce Figure 1                                                *;
. *     ****************************************************************  *;
. scatter portfolioshare seatshare if formateur==1, msymbol(O) mcolor(red) msize(medsmall) 
>         || scatter portfolioshare seatshare if formateur==0, msymbol(Oh) mcolor(eltblue) msize(medsmall) 
>         || line ports seats if seatshare>0 , lcolor(black) clpattern(solid) 
>         legend(col(1) size(2.5) region(lstyle(color(white))) order(1 2) position(5) ring(0) label(1 "{stSerif:Fo
> rmateur Party}") label(2 "{stSerif:Not a Formateur Party}"))
>         ||,
>         xtitle("{stSerif:Share of Government's Legislative Seats}", size(3) height(7)) 
>         ytitle("{stSerif:Share of Cabinet Portfolios}" , size(3) height(7))
>         xlabel(0 0.2 0.4 0.6 0.8 1.0, nogrid labsize(2.5))
>         ylabel(0 0.2 0.4 0.6 0.8 1.0, nogrid labsize(2.5)) 
>         scheme(s2mono) graphregion(fcolor(white) ilcolor(white) lcolor(white));

.  graph export "C:\Users\sgolder\Dropbox\Portfolio Allocation\replication\europe.eps", replace;
(file C:\Users\sgolder\Dropbox\Portfolio Allocation\replication\europe.eps written in EPS format)

. log close;
      name:  <unnamed>
       log:  C:\Users\sgolder\Dropbox\Portfolio Allocation\replication\figure1.log
  log type:  text
 closed on:  30 Mar 2017, 13:55:32
------------------------------------------------------------------------------------------------------------------
